import type { Result } from '@/utils/http.ts'

export interface DepartmentInfo {
  id: number,
  name: string,
  location: string,
}

export interface DialogForm {
  name: string,
  location: string
}

export interface argsQuery {
  id?: number,
  name?: string,
  location?: string,
  currentPage: number,
  pageSize: number,
}

export interface argsAdd {
  name: string,
  location: string,
}

export interface argsUpdate extends argsAdd {
  id: number,
}

export type argsDelete = argsUpdate

export type resultAdd = Promise<Result<null>>;
export type resultUpdte = Promise<Result<null>>;
export type resultDelete = Promise<Result<null>>;
export type resultGet = Promise<Result<DepartmentInfo>>;
export type resultList = Promise<Result<DepartmentInfo[]>>;

export interface Page<T> {
  countId: number,
  current: number,
  pages: number,
  size: number,
  total: number
  records: T[],
}

export type resultPage = Promise<Result<{
  countId: number,
  current: number,
  pages: number,
  size: number,
  total: number
  records: DepartmentInfo[],
}>>;


